package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

/**
 * 字符流：java.io.Reader和java.io.Writer
 * 上述两个流是抽象类，是所有字符流的超类，定义了所有字符流都具备的读写字符的操作
 * 字符流都是高级流
 *
 * 转换流：java.io.InputStreamReader和
 * */
public class OswDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("osw.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        osw.write("飞来湖发完货复盘成佛i娃娃怕 ");
        osw.write("喜洋洋与灰太狼");
        System.out.println("写出完毕");
        osw.close();
    }
}
